﻿#region << 文 件 说 明 >>

/*----------------------------------------------------------------
// 文件名称：TextBlockAddUnderLine
// 创 建 者：杨程
// 创建时间：2021/8/26 11:36:38
// 文件版本：V1.0.0
// ===============================================================
// 功能描述：
//
//
//----------------------------------------------------------------*/

#endregion

namespace Vampirewal.Core.WPF.Theme;

public class TextBlockAddUnderLine : DependencyObject
{
    public static bool GetIsSetUnderLine(DependencyObject obj)
    {
        return (bool)obj.GetValue(IsSetUnderLineProperty);
    }

    public static void SetIsSetUnderLine(DependencyObject obj, bool value)
    {
        obj.SetValue(IsSetUnderLineProperty, value);
    }

    // Using a DependencyProperty as the backing store for IsSetUnderLine.  This enables animation, styling, binding, etc...
    public static readonly DependencyProperty IsSetUnderLineProperty =
        DependencyProperty.RegisterAttached("IsSetUnderLine", typeof(bool), typeof(TextBlockAddUnderLine), new PropertyMetadata(false, OnIsSetUnderLineChanged));

    private static void OnIsSetUnderLineChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
    {
        //var titleTextBlock = obj as TitleTextBlock;
        //if (titleTextBlock != null)
        //{
        //    //((TextBlock)titleTextBlock.FindName("NeiRong")).TextDecorations = TextDecorations.Underline;
        //    titleTextBlock.NeiRong.TextDecorations = TextDecorations.Underline;
        //}
    }
}